/*
 * @Author: lg
 * @Date: 2024-05-21 09:06:16
 * @LastEditors: lg
 * @LastEditTime: 2024-05-23 17:59:50
 * @Description:
 * @FilePath: \bi-main\src\router\index.js
 */
import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/components/layout/index.vue';

const { VITE_APP_MODE } = import.meta.env;

const routes = [
  {
    path: '/',
    // redirect: '/my-portal',
    redirect: '/edit-screen',
    component: Layout,
    meta: {
      title: '首页'
    },
    children: [
      {
        path: 'edit-screen',
        name: 'edit-screen',
        component: () =>
          import('@/views/design-center/screens/edit-screen/index.vue')
      },
      {
        path: 'preview-screen',
        name: 'preview-screen',
        component: () =>
          import(
            '@/views/design-center/screens/preview-screen/big-preview/index.vue'
          )
      }
    ]
  }
];

const history =
  VITE_APP_MODE === 'dev' ? createWebHistory() : createWebHistory('/lg-bi/');

const router = createRouter({
  history,
  routes
});

export default router;
